Controls, environment, observation, and the first gallery screens - #22
Merged
Conversation
Text(verbatim:), ScrollView, Color/Image/ProgressView/Slider/TextField/Picker primitives with their bindings; @Environment object injection and @observable change tracking through the same reflection seam as @State; and the cornerRadius/offset/rotation/scale/opacity modifiers.
ScrollView, Color, ProgressView, Slider, TextField (uncontrolled-with- reconciliation so the cursor survives), Picker via a dropdown, and the clip/offset/rotation/scale/opacity modifier folds.
Text, Buttons, Stacks, State, Controls, Modifiers, and Observation screens render through the Compose pipeline; NavigationStack navigation returns later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fifth step of the Compose-backed architecture (#18–#21). With the pipeline proven end-to-end in #21, this grows the vocabulary: form controls,
@Environment/@Observable, effect modifiers, and the first seven gallery screens — restored and rendering through Compose.Core (host-tested)
Text(verbatim:),ScrollView,Color(as a fill view),Image,ProgressView,Slider,TextField,Picker(with.tag), plusLazyVStack/LazyHStackaliases.@Environment: object injection down a subtree via.environment(_:), read by@Environment(Model.self). Values flow down evaluation and never cross the bridge.@Observable:evaluate()wraps the body walk inwithObservationTracking; a later mutation of any observed property schedules re-evaluation exactly like a@Statewrite, re-arming each pass. Both use the same reflection seam as@State.cornerRadius,offset,rotationEffect,scaleEffect,opacity.swift test: 18 tests, all passing — adds slider/text-field binding round-trips, picker tag extraction + selection mapping, environment injection reaching a nested@Environment, and an@Observablemutation firing the change hook.Interpreter
New node types:
ScrollView(scroll state),Color,ProgressView(linear/circular),Slider,TextField,Picker(dropdown). TextField uses uncontrolled-with-reconciliation — Compose owns theTextFieldValue,lastSenttracks the pushed value so an echo leaves the cursor alone and an external change adopts Swift's value with the cursor at the end. Modifier folds added for clip/offset/rotation/scale/opacity.Gallery
Text, Buttons, Stacks, State, Controls, Modifiers, and Observation screens restored verbatim and driven through the Compose renderer, selected by a
Picker(fullNavigationStack/Listnavigation returns in the next step). The host content now insets from the system bars (safeDrawingPadding), fixing the R4 status-bar overlap.Verification
On the emulator:
@State→ re-evaluate → recompose round trip. Indeterminate spinner, determinate bar, slider, text field all render.Note
AndroidKitmust not be imported by app code (itsAndroidView.Viewcollides with the core'sView); the umbrella re-exports the core, andAndroidSwiftUILogcovers logging. The gallery screens compile unchanged against real SwiftUI on Apple platforms via the#if canImportgate.